﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Pavilion.DesignerTool.ViewTools
{
    public class PropertyCategory
    {
        public string CatergoryName { get { return AssociatedItem.ToString(); } }
        public IEnumerable<PropertyItemWrapper> Properties { get { return propertiesDictionary.ValueCollection; } }
        public object AssociatedItem { get; private set; }

        private NotifiableDictionary<IPropertyItem, PropertyItemWrapper> propertiesDictionary;

        public PropertyCategory(object associatedItem)
        {
            this.AssociatedItem = associatedItem;
            propertiesDictionary = new NotifiableDictionary<IPropertyItem, PropertyItemWrapper>();
        }

        public void AddProperty(IPropertyItem property)
        {
            propertiesDictionary.Add(property, new PropertyItemWrapper(property));
        }

        public void RemoveProperty(IPropertyItem property)
        {
            propertiesDictionary.Remove(property);
        }

        public void Clear()
        {
            propertiesDictionary.Clear();
        }
    }
}
